package com.w.utils.thread.concurrent;
/**
 *
 **/

import java.util.concurrent.Callable;

/**
 * @Author weiwei
 * @Date 2020-11-18 21:50
 * @description 保存线程threadLocal类的Callable
 **/
public abstract class ConcurrentCallableThreadLocal implements Callable {
    private static ThreadLocal<Object> local = new ThreadLocal<>();

    public ConcurrentCallableThreadLocal() {
    }

    static void setThreadLocal(Object o) {
        local.set(o);
    }

    static void removeThreadLocal() {
        local.remove();
    }

    public static Object getThreadLocal() {
        return local.get();
    }
}
